package com.fangyi.yunmusic.controller;

import com.fangyi.yunmusic.service.PlaylistService;
import com.fangyi.yunmusic.service.PlaylistTagService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/playlistTag")
public class PlaylistTagController {
    @Autowired
    private PlaylistTagService playlistTagService;
    @PostMapping("/add")
    public Object addPlaylistTag(String tagName,String playlistId){
        playlistTagService.addPlaylistTag(tagName,playlistId);
        return "OK";
    }
    @PostMapping("/delete")
    public Object removePlaylistTag(String tagId){
        playlistTagService.removePlaylistTag(tagId);
        return "OK";
    }
    @GetMapping("/all")
    public Object getAllPlaylistTagVOs(){
        return playlistTagService.getAllPlaylistTagVOs();
    }
    @GetMapping("/pagination")
    public Object getPlaylistVOByTagId(String tagId,Integer page,Integer pageSize){
        return playlistTagService.getPlaylistVOsByTagId(tagId,page,pageSize);
    }
}
